Skip to content

ref(analytics): Transform analytics events for TET-826 #95206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

constantinius
Copy link
Contributor

  • Transform event classes to use @analytics.eventclass decorator
  • Transform analytics.record calls to use event class instances
  • Update imports as needed

Closes TET-826

- Transform event classes to use @analytics.eventclass decorator
- Transform analytics.record calls to use event class instances
- Update imports as needed

Closes TET-826
@constantinius constantinius requested a review from a team as a code owner July 10, 2025 09:12
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 10, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #95206      +/-   ##
==========================================
+ Coverage   80.46%   87.84%   +7.38%     
==========================================
  Files       10478    10478              
  Lines      605960   605789     -171     
  Branches    23674    23641      -33     
==========================================
+ Hits       487562   532140   +44578     
+ Misses     118034    73289   -44745     
+ Partials      364      360       -4     

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Type Annotations for IDs

The organization_id and project_id attributes in PreprodArtifactApiAssembleEvent, PreprodArtifactApiUpdateEvent, and PreprodArtifactApiAssembleGenericEvent are incorrectly type-annotated as str. They should be int as they receive integer IDs from Django models (e.g., project.organization_id, project.id).

src/sentry/preprod/analytics.py#L5-L20

class PreprodArtifactApiAssembleEvent(analytics.Event):
organization_id: str
project_id: str
user_id: int | None = None
@analytics.eventclass("preprod_artifact.api.update")
class PreprodArtifactApiUpdateEvent(analytics.Event):
organization_id: str
project_id: str
@analytics.eventclass("preprod_artifact.api.assemble_generic")
class PreprodArtifactApiAssembleGenericEvent(analytics.Event):
organization_id: str
project_id: str

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant